<?php 
ob_start();
session_start();

$page_title = 'eTAT';
require_once 'controller.php';

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>

<link href='./includes/css/style.css' rel='stylesheet' type='text/css'>
<link href='./includes/css/addgroup.css' rel='stylesheet' type='text/css'>

<script language='JavaScript' type='text/javascript' src='./includes/js/mootools.js'></script>
<script language='JavaScript' type='text/javascript' src='./includes/js/default.js'></script>
<script language='JavaScript' type='text/javascript' src='./includes/js/addgroup.js'></script>

</head>

<body>
<div id="wrapper" > 
<div id="page-container">

<?php
	 
		if(isset($_GET['m']) || isset($_SESSION['m'])) {
			$m = $_GET['m']? $_GET['m'] : $_SESSION['m'];
			unset($_SESSION['m']);
			switch($m) {
				case '1': $msg = "Logged out successfully"; break;
				case '2': $msg = "Invalid Username/Password, Please try again"; break; 
				case '3': $msg = "You need to be logged in to view that page"; break;
				case '4': $msg = "Password reset successful, please check your email"; break;
				case '5': $msg = "Sorry, you cannot access that file."; break;
				case '6': $msg = "Sorry, that Email Address was not found in our database. Please contact the Administrator"; break;
				case '7': $msg = "Sorry, you need to be invited first in order to register. Please contact the Administrator."; break;
				case '8': $msg = "the user already exists...Please try again."; break;
			}
			//printMsg($msg); 
			//unset($_SESSION['m']);
		}
		if(isLoggedIn()) { 
	 
		require_once('logout.php');
		?>
        <div id="logo"><img src="./includes/images/logo.png" /></div>
		   <div id="nav">
            <ul><li>&nbsp;</li></ul>
            </div>
		<?php 
			
		} else{
		?>
		<img src="includes/images/index.jpg" />
		
		<?php }?>
  
  <div id="fade" class='invisible' onclick='closePopup();'></div>
 <?php if(!isLoggedIn()) { ?> <div id="nav">
       	  
        </div>
        <?php }?>
        
 <?php printMsg($msg); ?>
 